<template>
  <el-card>
    <div class="head">
      <div>
				{{$t("home.remunerationIncome")}}
			</div>
      <el-tabs v-if="isReal" v-model="activeName" @tab-click="handleClick">
        <el-tab-pane :label="$t('home.totalRevenue')" name="allshow"> </el-tab-pane>
        <!-- <el-tab-pane label="奖励保障" name="second"> </el-tab-pane> -->
        <el-tab-pane :label="$t('home.rewardDetails')" name="taxDetails"> </el-tab-pane>
        <el-tab-pane :label="$t('home.taxDetails')" name="rewardDetails"> </el-tab-pane>
      </el-tabs>
      <!-- <router-link class="tocent" to="/author/center/userInfo">查看></router-link> -->
    </div>
    <div v-if="isReal">
      <router-view></router-view>
    </div>
    <div v-else class="noReal d_h_col">
      <img src="../../../assets/noData.png" alt="" />
      <p >{{$t("home.notVerifiedYourRealName")}}</p>
      <router-link to="/author/center/userInfo/realInfo">{{$t("home.goToTheRealName")}}</router-link>
    </div>
      <!-- <img src="../../../assets/noData.png" alt=""> -->
  </el-card>
</template>

<script>
export default {
  data: function () {
    return {
      isReal: true,
      activeName: this.$route.query.name,
    };
  },
  components: {},
  methods: {
    handleClick(tab, event) {
      switch (tab.name) {
        case "allshow":
          this.$router.push({ path: "allshow", query: { name: "allshow" } });
          break;
        case "taxDetails":
          this.$router.push({
            path: "taxDetails",
            query: { name: "taxDetails" },
          });
          break;
        case "rewardDetails":
          this.$router.push({
            path: "rewardDetails",
            query: { name: "rewardDetails" },
          });
      }

      // console.log(tab,event)
    },
  },
  mounted() {
    console.log(this.$route, "ddddd");
  },
  created() {
    console.log(this.$store.state.userInfo.isReal)
    if (this.$store.state.userInfo.isReal) {
      this.isReal = true;
    }
  },
};
</script>


<style scoped="scoped" lang="scss">
.head {
  font-size: 24px;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: #333333;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.noReal {
  width: 100%;
  padding: 100px 0;
  img {
    margin: 0 auto;
    margin-bottom: 10px;
  }
  p {
    color: #cd001a;
    text-align: center;
    margin-bottom: 20px;
  }
  a {
    margin: 0 auto;
    color: #21d4cf;
  }
}
</style>
